Optimal. Leaf size=185 \[ -\frac {(10 A-7 B+4 C) x}{2 a^2}+\frac {(12 A-8 B+5 C) \sin (c+d x)}{a^2 d}-\frac {(10 A-7 B+4 C) \cos (c+d x) \sin (c+d x)}{2 a^2 d}-\frac {(10 A-7 B+4 C) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A-B+C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {(12 A-8 B+5 C) \sin ^3(c+d x)}{3 a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.25, antiderivative size = 185, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.146, Rules used = {4169, 4105,
3872, 2713, 2715, 8} \begin {gather*} -\frac {(12 A-8 B+5 C) \sin ^3(c+d x)}{3 a^2 d}+\frac {(12 A-8 B+5 C) \sin (c+d x)}{a^2 d}-\frac {(10 A-7 B+4 C) \sin (c+d x) \cos (c+d x)}{2 a^2 d}-\frac {(10 A-7 B+4 C) \sin (c+d x) \cos ^2(c+d x)}{3 a^2 d (\sec (c+d x)+1)}-\frac {x (10 A-7 B+4 C)}{2 a^2}-\frac {(A-B+C) \sin (c+d x) \cos ^2(c+d x)}{3 d (a \sec (c+d x)+a)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 3872
Rule 4105
Rule 4169
Rubi steps
\begin {align*} \int \frac {\cos ^3(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{(a+a \sec (c+d x))^2} \, dx &=-\frac {(A-B+C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {\int \frac {\cos ^3(c+d x) (3 a (2 A-B+C)-a (4 A-4 B+C) \sec (c+d x))}{a+a \sec (c+d x)} \, dx}{3 a^2}\\ &=-\frac {(10 A-7 B+4 C) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A-B+C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}+\frac {\int \cos ^3(c+d x) \left (3 a^2 (12 A-8 B+5 C)-3 a^2 (10 A-7 B+4 C) \sec (c+d x)\right ) \, dx}{3 a^4}\\ &=-\frac {(10 A-7 B+4 C) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A-B+C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {(10 A-7 B+4 C) \int \cos ^2(c+d x) \, dx}{a^2}+\frac {(12 A-8 B+5 C) \int \cos ^3(c+d x) \, dx}{a^2}\\ &=-\frac {(10 A-7 B+4 C) \cos (c+d x) \sin (c+d x)}{2 a^2 d}-\frac {(10 A-7 B+4 C) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A-B+C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {(10 A-7 B+4 C) \int 1 \, dx}{2 a^2}-\frac {(12 A-8 B+5 C) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{a^2 d}\\ &=-\frac {(10 A-7 B+4 C) x}{2 a^2}+\frac {(12 A-8 B+5 C) \sin (c+d x)}{a^2 d}-\frac {(10 A-7 B+4 C) \cos (c+d x) \sin (c+d x)}{2 a^2 d}-\frac {(10 A-7 B+4 C) \cos ^2(c+d x) \sin (c+d x)}{3 a^2 d (1+\sec (c+d x))}-\frac {(A-B+C) \cos ^2(c+d x) \sin (c+d x)}{3 d (a+a \sec (c+d x))^2}-\frac {(12 A-8 B+5 C) \sin ^3(c+d x)}{3 a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(473\) vs. \(2(185)=370\).
time = 1.89, size = 473, normalized size = 2.56 \begin {gather*} \frac {\sec \left (\frac {c}{2}\right ) \sec ^3\left (\frac {1}{2} (c+d x)\right ) \left (-36 (10 A-7 B+4 C) d x \cos \left (\frac {d x}{2}\right )-36 (10 A-7 B+4 C) d x \cos \left (c+\frac {d x}{2}\right )-120 A d x \cos \left (c+\frac {3 d x}{2}\right )+84 B d x \cos \left (c+\frac {3 d x}{2}\right )-48 C d x \cos \left (c+\frac {3 d x}{2}\right )-120 A d x \cos \left (2 c+\frac {3 d x}{2}\right )+84 B d x \cos \left (2 c+\frac {3 d x}{2}\right )-48 C d x \cos \left (2 c+\frac {3 d x}{2}\right )+516 A \sin \left (\frac {d x}{2}\right )-381 B \sin \left (\frac {d x}{2}\right )+264 C \sin \left (\frac {d x}{2}\right )-156 A \sin \left (c+\frac {d x}{2}\right )+147 B \sin \left (c+\frac {d x}{2}\right )-120 C \sin \left (c+\frac {d x}{2}\right )+342 A \sin \left (c+\frac {3 d x}{2}\right )-239 B \sin \left (c+\frac {3 d x}{2}\right )+164 C \sin \left (c+\frac {3 d x}{2}\right )+118 A \sin \left (2 c+\frac {3 d x}{2}\right )-63 B \sin \left (2 c+\frac {3 d x}{2}\right )+36 C \sin \left (2 c+\frac {3 d x}{2}\right )+30 A \sin \left (2 c+\frac {5 d x}{2}\right )-15 B \sin \left (2 c+\frac {5 d x}{2}\right )+12 C \sin \left (2 c+\frac {5 d x}{2}\right )+30 A \sin \left (3 c+\frac {5 d x}{2}\right )-15 B \sin \left (3 c+\frac {5 d x}{2}\right )+12 C \sin \left (3 c+\frac {5 d x}{2}\right )-3 A \sin \left (3 c+\frac {7 d x}{2}\right )+3 B \sin \left (3 c+\frac {7 d x}{2}\right )-3 A \sin \left (4 c+\frac {7 d x}{2}\right )+3 B \sin \left (4 c+\frac {7 d x}{2}\right )+A \sin \left (4 c+\frac {9 d x}{2}\right )+A \sin \left (5 c+\frac {9 d x}{2}\right )\right )}{192 a^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.78, size = 192, normalized size = 1.04
method | result | size |
derivativedivides | \(\frac {-\frac {A \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+\frac {B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}-\frac {C \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+9 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-7 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+5 C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {4 \left (\left (-5 A +\frac {5 B}{2}-C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {20 A}{3}+4 B -2 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-3 A +\frac {3 B}{2}-C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}-2 \left (10 A -7 B +4 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) | \(192\) |
default | \(\frac {-\frac {A \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+\frac {B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}-\frac {C \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+9 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-7 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+5 C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {4 \left (\left (-5 A +\frac {5 B}{2}-C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {20 A}{3}+4 B -2 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-3 A +\frac {3 B}{2}-C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}-2 \left (10 A -7 B +4 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) | \(192\) |
norman | \(\frac {\frac {\left (10 A -7 B +4 C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {\left (19 A -12 B +7 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {\left (10 A -7 B +4 C \right ) x}{2 a}-\frac {\left (A -B +C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}-\frac {\left (10 A -7 B +4 C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {\left (10 A -7 B +4 C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}+\frac {\left (11 A -10 B +7 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 a d}-\frac {\left (21 A -13 B +9 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d}+\frac {\left (25 A -19 B +13 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}-\frac {\left (97 A -71 B +41 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a}\) | \(299\) |
risch | \(-\frac {5 A x}{a^{2}}+\frac {7 B x}{2 a^{2}}-\frac {2 x C}{a^{2}}+\frac {i A \,{\mathrm e}^{2 i \left (d x +c \right )}}{4 a^{2} d}-\frac {i {\mathrm e}^{2 i \left (d x +c \right )} B}{8 a^{2} d}-\frac {15 i A \,{\mathrm e}^{i \left (d x +c \right )}}{8 a^{2} d}+\frac {i B \,{\mathrm e}^{i \left (d x +c \right )}}{a^{2} d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} C}{2 a^{2} d}+\frac {15 i A \,{\mathrm e}^{-i \left (d x +c \right )}}{8 a^{2} d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} B}{a^{2} d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} C}{2 a^{2} d}-\frac {i A \,{\mathrm e}^{-2 i \left (d x +c \right )}}{4 a^{2} d}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} B}{8 a^{2} d}+\frac {2 i \left (15 A \,{\mathrm e}^{2 i \left (d x +c \right )}-12 B \,{\mathrm e}^{2 i \left (d x +c \right )}+9 C \,{\mathrm e}^{2 i \left (d x +c \right )}+27 \,{\mathrm e}^{i \left (d x +c \right )} A -21 B \,{\mathrm e}^{i \left (d x +c \right )}+15 C \,{\mathrm e}^{i \left (d x +c \right )}+14 A -11 B +8 C \right )}{3 d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{3}}+\frac {A \sin \left (3 d x +3 c \right )}{12 a^{2} d}\) | \(335\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 487 vs.
\(2 (175) = 350\).
time = 0.50, size = 487, normalized size = 2.63 \begin {gather*} \frac {A {\left (\frac {4 \, {\left (\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {20 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {15 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a^{2} + \frac {3 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {3 \, a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {a^{2} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} + \frac {\frac {27 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {60 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}\right )} - B {\left (\frac {6 \, {\left (\frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {5 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{2} + \frac {2 \, a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {\frac {21 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {42 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}\right )} + C {\left (\frac {\frac {15 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {24 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} + \frac {12 \, \sin \left (d x + c\right )}{{\left (a^{2} + \frac {a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.06, size = 173, normalized size = 0.94 \begin {gather*} -\frac {3 \, {\left (10 \, A - 7 \, B + 4 \, C\right )} d x \cos \left (d x + c\right )^{2} + 6 \, {\left (10 \, A - 7 \, B + 4 \, C\right )} d x \cos \left (d x + c\right ) + 3 \, {\left (10 \, A - 7 \, B + 4 \, C\right )} d x - {\left (2 \, A \cos \left (d x + c\right )^{4} - {\left (2 \, A - 3 \, B\right )} \cos \left (d x + c\right )^{3} + 6 \, {\left (2 \, A - B + C\right )} \cos \left (d x + c\right )^{2} + {\left (66 \, A - 43 \, B + 28 \, C\right )} \cos \left (d x + c\right ) + 48 \, A - 32 \, B + 20 \, C\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {A \cos ^{3}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx + \int \frac {B \cos ^{3}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos ^{3}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.50, size = 266, normalized size = 1.44 \begin {gather*} -\frac {\frac {3 \, {\left (d x + c\right )} {\left (10 \, A - 7 \, B + 4 \, C\right )}}{a^{2}} - \frac {2 \, {\left (30 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 15 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 40 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 18 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 9 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3} a^{2}} + \frac {A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 27 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 21 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.34, size = 202, normalized size = 1.09 \begin {gather*} \frac {\left (10\,A-5\,B+2\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {40\,A}{3}-8\,B+4\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (6\,A-3\,B+2\,C\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a^2\right )}-\frac {x\,\left (10\,A-7\,B+4\,C\right )}{2\,a^2}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {5\,A-3\,B+C}{2\,a^2}+\frac {2\,\left (A-B+C\right )}{a^2}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (A-B+C\right )}{6\,a^2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________